﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Adams.Public.Web.Business.Web.Areas.Membership.Profile
{
    public class CreditCard
    {
        public static Adams.Public.DataTransfer.Web.Areas.Membership.Profile.CreditCard.PageLoad PageLoad(string token)
        {
            var input = new Adams.Public.DataTransfer.MemberInfo()
            {
                Token = token
            };

            var data = Api.GetData<Adams.Public.DataTransfer.Profile.GetCreditCard>("Profile/GetCreditCard", input);

            var model = new Adams.Public.DataTransfer.Web.Areas.Membership.Profile.CreditCard.PageLoad();
            model.CreditCard = data.CreditCard;

            return model;
        }

        public static Adams.Public.DataTransfer.FormOutput SaveCreditCard(string token, Adams.Public.DataTransfer.Profile.SaveCreditCardInput input)
        {
            input.Token = token;
            var model = Api.GetData<Adams.Public.DataTransfer.FormOutput>("Profile/SaveCreditCard", input);
            return model;
        }
    }
}
